package com.zy.qudadid.ui.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.github.lzyzsd.jsbridge.BridgeWebView;
import com.zy.lcpassenger.R;
import com.zy.qudadid.network.Const;
import com.zy.qudadid.presenter.base.BasePresenterImp;
import com.zy.qudadid.ui.activity.base.ToolBarActivity;
import com.zy.qudadid.ui.widget.MyWebViewClient;

import butterknife.Bind;

public class WebViewActivity extends ToolBarActivity {

    @Bind(R.id.webview)
    BridgeWebView webView;

    private String id;

    @Override
    protected CharSequence provideTitle() {
        return null;
    }

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_web_view;
    }

    @Override
    public void initListeners() {

    }

    @Override
    protected void initThings(Bundle savedInstanceState) {
        super.initThings(savedInstanceState);

        id = getIntentData().getString("id");
        webView = (BridgeWebView) findViewById(R.id.webview);

//        WebSettings wSet = webview.getSettings();
//        wSet.setJavaScriptEnabled(true);

        // 设置WebView属性，能够执行Javascript脚本
        webView.getSettings().setJavaScriptEnabled(true);
        // set HadlerCallBack
//        webView.setDefaultHandler(new myHadlerCallBack());

        webView.setWebViewClient(new MyWebViewClient(webView));


//        webview.loadUrl("http://qxu1539570183.my3w.com/xunta/api.php?c=h5&a=xiangqing&userid="+new UserUtil(mContext).getSharedPreferences("member_id")+"&comeuserid="+id);
        webView.loadUrl(Const.BASE_URL+"api.php/Shop/popo?id="+id);
    }

    @Override
    public BasePresenterImp createPresenter() {
        return null;
    }



}
